package com.yixun.qfbao.model.enums;

/**
 * 是否开启到访延长时间限制
 */
public enum VisitProtectSwitchEnum {

    CLOSE(0,"关闭"),
    OPEN(1,"开启");

    private int code;
    private String name;

    VisitProtectSwitchEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }
    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static VisitProtectSwitchEnum getByCode(int code) {
        for (VisitProtectSwitchEnum item : VisitProtectSwitchEnum.values()) {
            if (item.getCode() == code) {
                return item;
            }
        }
        return null;
    }

}
